package day02;

public class HomeWork05 {
    public static void main(String[] args) {
        //自动转换 byte short int long float double char boolean
        //小转大，直接转；大转小，强制转
        int a = 5;
        long b = a;
        int c = (int)b;

        long d = 5;
        double e = 5;

        long f = 10000000000l;
        int g = (int)f;//超出int范围，强制转换发生溢出
        System.out.println(g);

        double h = 25.987;
        int i = (int)h;
        System.out.println(i);//强转可能丢失精度

        //两点规则
        byte b1 = 5;
        byte b2 = 6;
        byte b3 = (byte)(b1+b2);//逻辑运算自动转为int计算，结果为int类型，int到byte做强制转换

        System.out.println(2+2);
        System.out.println(2+'2');
        System.out.println('2' + '2');


    }

}
